tongfusoft.taskDetail = function() {
}
tongfusoft.taskDetail.prototype = {
		
		addTaskDetail:function(){
			
			$("#addBtn").click(function() {
				document.location.href=common.getContextPath("task/addDocTask/"+$("#taskId").val()+"?page");
			})
			
			
		},
		query:function(){
			var params={};
			params["taskId"]=$("#taskId").val();
			common.post('task/taskDetail?query',params,function(data){
				
				if(data.state=='success'){
					
					var html='';
					$.each(data.data.list,function(index,item){
						
						
						
						html=html+'<div class="list-group-item">';
						html=html+'<div class="media-box">';
						html=html+'<div class="pull-left">';
						html=html+'<span class="fa-stack">';
						html=html+'<em class="fa fa-circle fa-stack-2x text-success"></em>';
						html=html+'<em class="fa fa-clock-o fa-stack-1x fa-inverse text-white"></em>';
						html=html+'</span>';
						html=html+'</div>';
						html=html+'<div class="media-box-body clearfix">';
					
						html=html+'<small class="label  pull-right label-success ml">上传文件:'+item.docCount+'</small>';
						html=html+'<div class="media-box-heading">';
						html=html+'<a href="'+common.getContextPath("viewTaskDetail/"+item.taskDetailId+"?page")+'">';
						html=html+item.taskDetailName;
						html=html+'</a>';
						html=html+'</div>';
					
						html=html+'<p class="m0">';
						html=html+'<small>'+item.taskDetailNote+'</small>';
						html=html+'</p>';
						html=html+'<p class="m0">';
						
						$.each(item.taskTag.split(","),function(k,v){
							if(v!=''){
								html=html+'	<span class="tag label label-info">'+v+'</span>';

								
							}
						})
						
					
						html=html+'</p>';
						html=html+'<span>';
						html=html+'<small  ><em>计划完成时间:'+common.getSmpFormatDateByLong(item.taskPlanTime,"yyyy-MM-dd hh:mm")+'</em></small>';
						html=html+'</span><span class="mh-sm"></span>';
						
						html=html+'<span>';
						html=html+'<small ><em>完成时间:'+common.getSmpFormatDateByLong(item.taskFinishTime,"yyyy-MM-dd hh:mm")+'</em></small>';
						
						html=html+'</span>';
						html=html+'</div>';
						html=html+'</div>';
						html=html+'</div>';
					
					
					});
					
					$("#taskList").empty();
					$("#taskList").html(html);
					
				}
				
			});
			
		}
		
}

$(function(){
	
	var obj = new tongfusoft.taskDetail();
	obj.query();
	obj.addTaskDetail();
})